1. Field of the Invention
The invention generally relates to storage technology, and, more specifically, to a storage system using flash memory as storage media, and to a data protection method for that storage system.
2. Description of Related Art
Data storage systems usually have randomly accessible nonvolatile storage media. Examples of the randomly accessible nonvolatile storage media include magnetic disks and optical disks. Recent mainstream storage systems include many small disk drives. Also, as semiconductor technology progresses, block-erasable nonvolatile semiconductor memory has been developed. Block-erasable nonvolatile semiconductor memory is, for example, flash memory. Storage systems using flash memory as storage media are superior to storage systems having many small disk drives in service life, power-saving, and access time.
Flash memory is described in detail below. In flash memory, data is erased in units of blocks and read/written in units of pages, blocks and pages both being memory areas. It is a characteristic of flash memory that data cannot be directly updated. More specifically, when updating data in flash memory, valid data stored in the flash memory is first copied to another location. Then, the data is erased in block units. Then, new data is written in the freshly-erased block where the old data had been previously stored.
More specifically, with flash memory, it is possible to set bit ‘1’ to ‘0’ but not ‘0’ to ‘1.’ Therefore, to update data in flash memory, block(s) are erased. As explained above, data update in flash memory requires erasing of blocks.
However, the time required for erasing one block in flash memory is longer than the time required for writing data in one page, by an order of magnitude. Accordingly, if one block is erased every time data in one page is updated, the data update capacity of flash memory deteriorates to a considerable extent. In other words, with flash memory, it is necessary to write data with an algorithm that enables concealment of erase times.
In addition, flash memory has a finite number of block-erase cycles. For example, one hundred thousand erase cycles are guaranteed per one block. Accordingly, there is a problem with blocks with a large number of erase cycles due to a concentration of data update, in that the data can no longer be erased and the blocks cannot be used anymore. Accordingly, storage systems using flash memory as storage media must incorporate wear-leveling algorithms ensuring that erasing will not be concentrated on a certain storage block.
When writing data in a flash memory module, address translation is performed for erase-time concealment and wear-leveling. A flash memory module has one or more flash memory chips and a memory controller for controlling data transfer to the flash memory chip(s). In order to avoid concentration of data writing on a particular physical address, the memory controller has the function of converting a logical address—a write destination address—it receives from a host computer or the controller of a storage apparatus to a physical address, which is a write destination address in the flash memory chip. Here, the problem is an address error that may occur in the memory controller. If the memory controller causes an error when converting a logical address to a physical address, data is written in the wrong physical address. In other words, the write data itself has no problems or errors, but because it is written in the wrong physical address, there is a possibility that the data may not be read when desired.
The technique disclosed in Japanese Patent Laid-Open Publication No. 2001-202295 has been known as a method for solving the foregoing problem. With this technique, when using hard disk drives as storage media, data is protected from address errors in the storage media. More specifically, when writing data in a hard disk drive, the data is given protection codes including logical address values, the protection codes corresponding to the respective logical data blocks in the hard disk drive. When reading data from the hard disk drive, the protection codes given to the respective logical data blocks are checked.
Moreover, US Patent Publication No. 2004-0148461A1 discloses a storage system that guarantees compatibility between storage media having different data management units.
In flash memory, data is read/written using addresses mapped onto each page. The page size differs depending on the chip type and generation. For example, the page size of a current flash memory chip is 528 bytes or 2112 bytes and the size of the memory area data actually can be written in from outside a flash memory module is 512 bytes or 2048 bytes in the page. The rest of the page (e.g., 528 bytes minus 512 bytes, equal to 16 bytes; and 2112 bytes minus 2048 bytes, equal to 64 bytes) is used as a redundant section for storing information for a memory controller to manage addresses in page units and error correction codes for the memory controller to correct errors. With the trend in increasing flash memory capacity, the page size is expected to increase in size.
Flash memory modules intended to substitute for hard disk drives as storage media in storage systems have hard disk drive-compatible interfaces. Storage controllers recognize hard disk drive-compatible flash memory modules as hard disk drives each having 512 bytes per sector. In other words, the storage controllers cannot recognize the address-converted data units in the flash memory modules with the hard disk drive-compatible interfaces. Moreover, the page size differs depending on the type and generation of the flash memory chips implemented in the flash memory modules. In the foregoing conventional measures against address errors, it is necessary for storage controllers to add, to each data unit whose address is to be converted, a protection code to perform data writing.
However, as already mentioned above, with the flash memory modules having hard disk drive-compatible interfaces or flash memory modules having unclear chip specifications, the size of data to be protected from address errors is unclear. For this reason, it is difficult to protect data from address errors in the flash memory modules using conventional techniques.
In a hard disk drive requiring high reliability, the capacity of one sector is 520 bytes and data and protection codes are managed as a set. Meanwhile, in flash memory, the sizes of data that can be written in one page are multiples of 512 bytes, except for the memory areas used for management by the memory controller. If the data managed in 520-byte units is directly written in page(s) in the flash memory, the 520-byte pieces of data are written in the flash memory, sometimes spreading across the page boundaries. This means that the data and its protection code in one 520-byte piece are written in different pages and the data separated from the protection code is no longer protected from address errors. Accordingly, it is difficult to protect data spreading across the page boundaries from address errors using conventional techniques.
Embodiments of this invention were devised in light of the foregoing problems, and aims to provide a storage system able to correct address errors in flash memory modules that use different data management units from those used in hard disk drives; and a data protection method for this storage system.